package com.cloud.common.filter;

import com.cloud.common.constants.AuthBlankList;
import org.springframework.util.AntPathMatcher;

/**
 * 全局白名单校验
 *
 * @author yzj
 */
public class GlobalBlankCheck {

    // 路径匹配类
    public static boolean askUrlAuth(String pathUrl) {
        AntPathMatcher matcher = new AntPathMatcher();
        for (String strUrl : AuthBlankList.gateWayBlankList()) {
            if (matcher.match(strUrl, pathUrl)) {
                return true;
            }
        }
        return false;
    }

}
